#include<iostream>
#include<cmath>
#include<vector>
#define int long long
#define mod 998244353
using namespace std;

int fp(int a,int e ){
    int re = 1;
    a %= mod;
    while(e){
        if(e & 1){
            re = re*a % mod;
        }
        e >>= 1;
        a = (a* a) % mod;
    }
    return re;
}

int fm(int a,int b){
    int re = 0;
    a %= mod;
    while(b){
        if(b & 1){
            re = re + a% mod;
        }
        b >>= 1;
        a = (a * 2) % mod;
    }
    return re;
}

int jiec(int n){
    int re = 1;
    for(int i = 1 ;i <= n ; i++){
        re = fm(re,i);
    }
    return re;
}

int A(int a,int b){
    return (jiec(a) / jiec(b))%mod;
}

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,k;
    cin >> n >> k;
    if(n < k){
        cout << 0 << endl;
    }
    else if(n == k){
        cout << jiec(k)% mod << endl;
    }
    else{
        int cnt=n/k;
        int kjie=jiec(k);
        int res=1;
        if(cnt<=1){
            res=(kjie*jiec(n%k))%mod;
        }
        else {
            int cnt1=n%k;
            for(int i=1;i<=cnt-2;i++){
                res=(res*kjie)%mod;
            }
            if(cnt1==0)res=((res*kjie%mod)*kjie)%mod;
            else res=(res*(kjie*kjie-A(k,k-cnt1))*2+A(k,k-cnt1))%mod;
        }
        cout<<res;
    }
    return 0;
}
